package hips.gui.parameters;

import javax.swing.JSpinner;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

class ChangeParameterListener implements ChangeListener {
    JSpinner[] spinners;

    public ChangeParameterListener(JSpinner[] spinners){
        this.spinners = spinners;
    }

    public void stateChanged(ChangeEvent e) {
        for (int i = 0; i < spinners.length; i++){
            spinners[i].setValue(((JSpinner)e.getSource()).getValue());
        }
    };
}
